import { _decorator, Component, director, Node } from 'cc'
import FaderManager from '../../Runtime/FaderManager'
import { SCENE_ENUM } from '../../Enums'

const { ccclass } = _decorator


@ccclass('StartManager')
export class StartManager extends Component {
  onLoad() {
    FaderManager.Instance.fadeOut()
    this.node.once(Node.EventType.TOUCH_END, this.handleStart, this)
  }

  async handleStart() {
    await FaderManager.Instance.fadeIn(300)
    director.loadScene(SCENE_ENUM.BATTLE)
  }


}
